package com.ems.controller;

import com.ems.config.LogPointer;
import com.ems.service.IRoleMenuService;
import com.ems.vo.BaseResult;
import com.ems.vo.RoleMenuVo;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 角色权限表 前端控制器
 * </p>
 * @author WuZH
 * @since 2023-10-24
 */
@RestController
@RequestMapping ("/roleMenu")
@CrossOrigin (value = "*", maxAge = 3600)
public class RoleMenuController {

    @Resource
    private IRoleMenuService iRoleMenuService;

    /**
     * 给指定角色赋权
     * @param roleMenuVo
     * @return
     */
    @RequestMapping ("saveRoleMenu")
    @LogPointer ("新增角色权限列表")
    public BaseResult saveRoleMenu (@RequestBody RoleMenuVo roleMenuVo) {
        roleMenuVo = iRoleMenuService.saveRoleMenu ( roleMenuVo );
        return BaseResult.success ( roleMenuVo );
    }

}
